<%--
  Created by IntelliJ IDEA.
  User: zhangye
  Date: 2020-05-09
  Time: 22:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>Title</title>
    <style>
        #table tr:nth-child(even){
            background: lightpink;
        }
        #table th{
            background: #efefef;
        }
    </style>
</head>
<body>
<%@include file="common/AdminNavbar.jsp"%>
<table class="table" id="table">
    <caption>顾客信息</caption>
    <thead>
    <tr>
        <th>ID</th>
        <th>姓名</th>
        <th>密码</th>
        <th>邮箱</th>
        <th>地址</th>
        <th>联系方式</th>
        <th>删除</th>
    </tr>
    </thead>
    <tbody id="tbody">
    <c:forEach items="${customers}" var="item">
    <tr class="active" id="row">
        <td>${item.customerId}</td>
        <td>${item.name}</td>
        <td>${item.password}</td>
        <td>${item.email}</td>
        <td>${item.address}</td>
        <td>${item.telephone}</td>
        <td>
            <a href="/delCustomer?customerId=${item.customerId}" class="btn btn-outline-success" >删除</a>
        </td>

    </tr>
    </c:forEach>
    </tbody>
</table>
<script src="../js/jquery-1.12.4.js"></script>
<script>
    $(function () {
        $('tr:even').attr('class','success')
        /*
        var aStyle = ['primary','success','secondary','danger','warning','info','dark'];
        for(var i=0;i<aTr.length;i++){
            console.log(aTr[i]);
            console.log(aStyle[i])
            aTr[i].attr("class",aStyle[i]);
        };*/
    })
</script>
</body>
</html>
